<template>
	<page-meta><navigation-bar title="添加..." front-color="#000000" background-color="#ffffff" /></page-meta>
	<view>
		<!-- #ifdef MP-WEIXIN -->
		<u-navbar :is-back="false" title=" " :background="{ background: '#ffffff'  }" :border-bottom="false"></u-navbar>
		<!-- #endif -->
		<!-- #ifndef MP-WEIXIN -->
		<view class="status_bar"></view>
		<!-- #endif -->
		<view class="header">
			<view class="header_left">
				<image mode="aspectFill" :src="obj.headImg?obj.headImg:'/static/qq.png'" />
				<view class="header_left_content">
					<view class="header_left_content_name">{{obj.userName}}</view>
					<view class="header_left_content_number">微信号: {{obj.wechatNumber}}</view>
					<view class="header_left_content_number">所在地区: {{obj.address}}</view>
				</view>
			</view>
			<view class="header_right">
				<!-- <u-icon name="arrow-right"></u-icon> -->
			</view>
		</view>
		<view  style="height: 10rpx;"></view>
		<textarea v-model="obj.content" placeholder="请输入验证信息" style="background: #fff;width: 100%;padding: 10px;font-size: 14px;"/>
		<button @tap="send" type="default" style="background: #007AFF;color: #fff;position: fixed;width: 90%;margin: 0 auto;left: 5%;bottom: 10px;">添加</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				obj:{
					content: '',
					headImg: '',
					fromUserId: 0,
					userName:'',
					show: false,
					isTop: false,
					contentType: 1,
					sendtime: new Date(),
					wechatNumber:'',
					address:'',
					sendid:0,
					yanzheng:true
				}
			}
		},
		methods: {
			send(){
				var _this = this;
				uni.sendSocketMessage({
				      data: JSON.stringify(this.obj)
				});
				uni.showToast({
					title: '验证信息已发送！',
					icon: 'none',
					duration: 1500
				});
				setTimeout(function(){
					_this.$u.route({
						url: 'pages/home/home',
						type: 'switchTab'
					});
				},1500);
			}
		},
		onLoad(e) {
			this.obj.headImg = this._user_info.headImg;
			this.obj.fromUserId = this._user_info.userId;
			this.obj.userName = this._user_info.userName;
			this.obj.wechatNumber = this._user_info.userName;
			this.obj.address = this._user_info.address?this._user_info.address:'中国';
			this.obj.sendid = e.userId;
			// console.log(this.obj)
		}
	}
</script>

<style lang="scss" scoped>
	.header{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 60rpx 38rpx;
		background-color: #ffffff;
		&_left{
			display: flex;
			align-items: center;
			&_content{
				padding-left: 20rpx;
				&_name{
					font-weight: bold;
				}
				&_number{
					color:#969799 ;
					font-size: 26rpx;
				}
			}
		}
		&_right{
			font-size: 28rpx;
			color: #969799;
		}
		image {
			width: 100rpx;
			height: 100rpx;
			border-radius: 6rpx;
		}
	}
.status_bar {
	height: var(--status-bar-height);
	width: 100%;
}
</style>
